import request from '@/utils/request'

// 查询处方单退药明细列表
export function listReturn(query) {
  return request({
    url: '/order/return/list',
    method: 'get',
    params: query
  })
}

// 查询处方单退药明细详细
export function getReturn(id) {
  return request({
    url: '/order/return/' + id,
    method: 'get'
  })
}

// 新增处方单退药明细
export function addReturn(data) {
  return request({
    url: '/order/return',
    method: 'post',
    data: data
  })
}

// 修改处方单退药明细
export function updateReturn(data) {
  return request({
    url: '/order/return',
    method: 'put',
    data: data
  })
}

// 删除处方单退药明细
export function delReturn(id) {
  return request({
    url: '/order/return/' + id,
    method: 'delete'
  })
}

// 导出处方单退药明细
export function exportReturn(query) {
  return request({
    url: '/order/return/export',
    method: 'get',
    params: query
  })
}

// 获取处方商品可退明细列表
export function getReturnList(diagnoseId) {
  return request({
    url: `/order/return/${diagnoseId}/list/`,
    method: 'get',
  })
}

// 退药保存
export function returnBatchAdd(data) {
  return request({
    url: `/order/return/batch/add/`,
    method: 'post',
    data: data
  })
}
